package com.xiaoyun.bo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Objects;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ShopcartBO {

    private String itemId;

    private String itemImgUrl;

    private String itemName;

    private String specId;

    private String specName;

    private Integer buyCounts;

    private String priceDiscount;

    private String priceNormal;

    public ShopcartBO(String itemId, String specId, Integer buyCounts) {
        this.itemId = itemId;
        this.specId = specId;
        this.buyCounts = buyCounts;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ShopcartBO that = (ShopcartBO) o;
        return Objects.equals(itemId, that.itemId) &&
                Objects.equals(itemImgUrl, that.itemImgUrl) &&
                Objects.equals(itemName, that.itemName) &&
                Objects.equals(specId, that.specId) &&
                Objects.equals(specName, that.specName) &&
                Objects.equals(priceDiscount, that.priceDiscount) &&
                Objects.equals(priceNormal, that.priceNormal);
    }

    @Override
    public int hashCode() {
        return Objects.hash(itemId, itemImgUrl, itemName, specId, specName, priceDiscount, priceNormal);
    }
}
